let f7 = null;
let photo = null;

class Photo {
  static init(app) {
    f7 = app;
  }

  static create(param, index = 0) {
    Photo.dismiss();
    photo = f7.photoBrowser.create(param);
    return photo;
  }

  static show(param, index = 0) {
    Photo.dismiss();
    photo = f7.photoBrowser.create(param).open(index)
  }

  static dismiss(animate = true) {
    let result = false;

    if (null != photo && photo.opened) {
      // photo.close(animate).destroy()
      photo.close(animate)
      photo = null;
      result = true
    }

    return result;
  }
}

export default Photo;
